package com.funcpro.common.utils;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;

/**
 * @author ZYT
 * @desc
 * @time 2023-11-08 15:45
 */
public class PageUtils {

    public static <T> JSONObject listToJsonObject(Page<T> list) {
        JSONObject result = new JSONObject();
        result.put("list", list);
        result.put("pageNo",list.getPages());
        result.put("pagesize", list.getPageSize());
        result.put("total", list.getTotal());
        return result;
    }
}
